<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1.0">
	<title>长安大学考务管理系统</title>
	<link rel="stylesheet" href="verify.css">
</head>
<body>
	<div class="main">
		<div class="wave"></div>	
	</div>
<%
/*
管理员和普通教师的区别写在session
管理员
账号：admin
密码：1234

普通老师
其他任意账号密码
*/

final String admin_username = "admin";
final String admin_password = "1234";
final String username = "techer";
final String password = "1234";

String url = "index.jsp";

request.setCharacterEncoding("UTF-8");//设置请求编码

String p_username = request.getParameter("username");
String p_password = request.getParameter("password");

if (p_username != null && p_password != null) {
	if(p_username.equals(admin_username) && p_password.equals(admin_password))
	{
		session.setAttribute("username", p_username);
		session.setAttribute("usertype", "admin");//管理员
		url = "index.jsp";
	}
	else
	{
		session.setAttribute("username", p_username);
		session.setAttribute("usertype", "ordinary");//普通用户
		url = "index.jsp";
		
	}
	
	//response.sendRedirect(url);
	response.setHeader("Refresh","3;url=index.jsp");
	return;
}
%>
</body>
</html>